#pragma once

#include "../common/BasePclModel.h"
#include "includeBase.h"

class RegionGrowingSegmentationModel : public BasePclModel
{
public:
    RegionGrowingSegmentationModel();

public:
    static RegionGrowingSegmentationModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    QString pcdFile() const { return pcdFile_; }
    void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    QString pcdFormat() const { return pcdFormat_; }
    void setPcdFormat(const QString& pcdFormat) { pcdFormat_ = pcdFormat; }

    double distanceThreshold() const { return distanceThreshold_; }
    void setDistanceThreshold(double distanceThreshold) { distanceThreshold_ = distanceThreshold; }

    double pointColorThreshold() const { return pointColorThreshold_; }
    void setPointColorThreshold(double pointColorThreshold) { this->pointColorThreshold_ = pointColorThreshold; }

    double regionColorThreshold() const { return regionColorThreshold_; }
    void setRegionColorThreshold(double regionColorThreshold) { this->regionColorThreshold_ = regionColorThreshold; }

    uint32_t minClusterSize() const { return minClusterSize_; }
    void setMinClusterSize(uint32_t minClusterSize) { this->minClusterSize_ = minClusterSize; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/region_growing_rgb_tutorial.pcd";
    QString pcdFormat_ = "PointXYZRGB";

    double distanceThreshold_ = 10.0;
    double pointColorThreshold_ = 6.0;
    double regionColorThreshold_ = 5.0;
    uint32_t minClusterSize_ = 600;
};
